package com.siteseat.crudeq.kernel;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

import com.siteseat.crudeq.kernel.impl.PersistedChunkManager;

/**
 *
 */
public interface KernelFactory {

  Queue newQueue( QueueProfile profile, ChunkManager chunkManager ) throws Exception;
  
  PersistedChunkManager newPersistedChunkManager( QueueProfile profile ) throws Exception;

  Chunk newChunk( ChunkInfo info, int capacity ) throws IOException;

  ChunkFileFilter newChunkFileFilter( QueueProfile profile );
  
  ChunkInfo newChunkInfo( QueueProfile prof, Long chunkId ) throws IOException;

  ChunkInfo newChunkInfo( QueueProfile prof, File file, Long chunkId ) throws FileNotFoundException;
  
  ChunkWriter newChunkWriter( ChunkInfo info ) throws IOException;
  
  Message newMessage( Chunk s, int offset, int messageSize );
  
  MessageHistory newMessageHistory( Integer queueId, List<ChunkInfo> chunks, int offset );
  
}
